package au.com.bluelink.scjp.chap2;

public class ConstructorTest {

	public static void main(String[] args) {
		
		SubClass sub = new SubClass();

	}

}

class SuperClass {
	
	// this constructor will not be visible to the sub class
	private SuperClass() {
		System.out.println("SuperClass constructor -> SuperClass()");
	}
	
	// declare a visible constructor that the sub class can call
	SuperClass(int i) {
		// we can make a call to the private constructor for this class here...
		this();
		System.out.println("SuperClass constructor -> SuperClass(int i)");
	}
}


class SubClass extends SuperClass {
	
	SubClass() {
		// must make an explicit call to the visible super constructor
		// because the implicit call to super() is not visible
		super(33);
		System.out.println("SubClass constructor -> SubClass()");
	}
	
}